home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d19
/
exzt11.arc
/
EXZTEST.DOC
< prev
next >
Wrap
Text File
|
1990-06-15
|
17KB
|
524 lines
ExZTEST
The On-Line File Integrity Check Program
Written for PCBoard v14.5 systems
Release version 1.0
Copyright 1990, Andy Keeves
The Executive Network Information System
All rights reserved
INTRODUCTION
------------
ExZTest is a simple program to help file validation on a
PCBoard v14.5 system. Starting with this version, PCBoard
introduced on-line upload verification and file testing ability
through a shelled process. Although it seems simple enough to use
PKUNZIP's -t option for verification, there are a number of other
items which can be done and were apparently desirable by some.
Thus, ExZTest was born.
ExZTest will simply create a PCBFAIL.TXT or PCBPASS.TXT file
when invoked with the proper command line options. These files
will be used and displayed by PCBoard to notify the caller of the
results.
ExZTest will handle files created by PKWare's PKZIP, PKPACK
and PKARC programs, as well as SEA's ARC and NoGate Consulting's
PAK programs. Although it relies on the original program (such as
PKUNZIP) to do the actual testing, it further studies the
compressed file for optional parameters.
EXZTEST OPERATION AND INSTALLATION
----------------------------------
ExZTest must be installed in PCBoard's PCBTEST.BAT file.
Note that PCBoard will pass two parameters to this file, the
first being the path and file name to test and the second the
optional keyword UPLOAD. You can do some interesting things with
this file, of course, but we'll keep the examples fairly simple
here. Since most Sysops that I know use the .ZIP format for file
compression we'll concentrate on that one. The only difference
between .ZIP and the others is the program STRIPZIP which I am
not aware of existing for the other formats.
I do recommend you run STRIPZIP, not as much for the removal
of .ZIP comments as for the removal of any possible file
attributes from the .ZIP just uploaded! ExZTest assumes you use
it as a first step. If you wish not to, you can suppress the
related message from ExZTest (keep reading for the switches).
Note that PKUNZIP, PKUNPAK, PKXARC, PKZIP, STRIPZIP and/or
PAK must be in a DOS search path for ExZTest to function
correctly! You need only those programs which you use on your
system, of course.
A small program called CLEARERR.COM is included in the
distribution as well. Note that CLEARERR *MUST* BE LOCATED IN A
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 1
DOS PATH WHEN EXZTEST IS RUN! If curious why read the CAVEAT
section near the end.
Here is a sample PCBTEST.BAT file (also included in
ExZTest's distribution):
@ECHO OFF
@EXZTEST %1 0 %2
That seems simple enough, doesn't it? Place ExZTest.COM and
CLEARERR.COM in a DOS search path and you are nearly ready!
So, why is this better than simply running PKUNZIP you ask?
One reason is that ExZTest gives you a simple, clean response
file for the caller. You need not display all the notices you get
from the other programs. ExZTest also performs the following
functions for you:
o Automatically create PCBFAIL.TXT or PCBPASS.TXT;
o Generates all display files using PCBoard's "@Xnn"
color codes;
o Tells your caller what has been done, including the
stripping of the .ZIP comment, verification of the
file, listing of the content;
o Optionally removes unwanted files from the .ZIP.
o Handles the output properly when PCBoard's TEST command
has been invoked;
o Optionally, checks the age of the files inside the .ZIP
for a Sysop specified number of days. If the new file
is older, it will be forced to "fail" and upload credit
will be withheld pending your review of the file;
o Allows the suppression of the Stripzip message;
So, now you begin to see why this is useful, right? Let's take a
look at how all this is accomplished through the command line!
PROGRAM SYNTAX
--------------
ExZTest is invoked through a fairly simple command line
format, which consists of three required fields and a few
optional switches:
EXZTEST <filename> <days> [UPLOAD] [/switches]
Note that two of the three fields required are passed to it by
PCBoard via the PCBTEST.BAT file!
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 2
The following fields are required:
<filename> This parameter is passed to us by PCBoard as
batch parameter %1. It will likely include
the drive, path, file name and extension.
Should an extension be missing, ExZTest will
add a ".ZIP" automatically!
<days> This is a required parameter, expressed as
number of days backward in time from today.
To disable date checking, simply specify 0
(zero) for days. If you wish to allow only
files of a certain age, however, you can
specify that here as number of days, for
instance 90 to accept only files dated within
the last 90 days. Note that when the .ZIP
contains multiple files, the most recent date
within the .ZIP file will be used!
[UPLOAD] This parameter is also passed to us by
PCBoard and is also required. Specify it as
batch parameter %2. This is how ExZTest will
know whether we are executing a TEST or
checking a new upload.
The following switches are all optional:
/NS This switch will suppress the automatic use
of Stripzip, which is assumed. If you do not
wish to use Stripzip you must add this to the
command line! Note that StripZip will ONLY
be invoked if the file being tested has a
.ZIP extension!
/W If a number other than zero was specified for
<days> this switch will tell ExZTest not to
fail the file if it is found to be older than
expected, but rather to accept it and warn
the caller about the file's age. This is a
good way to get your callers used to the idea
that you'll be checking the age of files in
the future and rejecting the upload, rather
than spring it on them overnight.
/@<filespec> This is a list file containing unwanted
names. It is a simple ASCII text file, one
name per line, wildcards accepted, specifying
file name and extension. If the file exists,
ExZTest will shell to PKZIP and instruct it
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 3
to delete any of the files found in the
listfile from the newly uploaded .ZIP. This
option is ignored if processing a file with
extension other than .ZIP of course. A
typical use for this feature might be to
remove items from the new upload, such as BBS
ads and other undesirable files immediately.
/&<filespec> If you wish to override ExZTest's default
explanations for files which are found too
old (based on your criteria of days) you can
write your own text file using your favorite
editor. Whatever you place in this file will
be taken as is and appended to the PCBFAIL or
PCBPASS files, as required. You can use any
text, all of PCBoard's @ variables and @Xnn
color codes, of course. If this optional
file specification is not supplied, ExZTest
will use default explanations.
/b Turns on the bell option. The 'bell' will
sound using different tones for passing and
failing files (buzz for failure and chime for
pass).
That is the extent of it. The command line is not case
sensitive, however, spaces MUST separate the 3 main arguments.
ExZTest will return one of three DOS errorlevels upon
exiting to DOS:
Error level 0 : No problems encountered
Error level 1 : Target file not found or command
syntax error identified
Error level 2 : Target file failed tests
I readily admit that I am not sure what you might wish to do
with this information, however, it is there if desired.
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 4
CAVEAT
------
While working on this program I discovered what I can only
term a Microsoft bug for now. It apparently is unique to DOS
shells performed from BC7 programs, possibly other QuickBasic
versions as well. Apparently, during a shell to DOS from a BC7
program, the first use of the DOS errorlevel by a program running
in that shell simply clears the errorlevel and makes it useable.
I cannot figure why, but a simple .BAT file will work every time
from DOS, correctly setting the errorlevel, while only the second
setting of the errorlevel will take if it is ran from within a
BC7 shell.
To resolve this problem, I included a small program called
CLEARERR.COM which clears the DOS errorlevel to 0 and makes it
reliable withing the BC7 shell. As a result, CLEARERR must be
available to ExZTest while running. Without it, the reults of
all TEST operations and checking of uploads other than .ZIP files
will be totally unreliable! All you need to do is place it in
your DOS path and it will restore the errorlevel to a useable
shape.
DISCLAIMER
----------
EXZTEST is distributed "as is". The author makes no
guarantees as to these programs' ability to run or fitness for a
particular purpose in your specific computing environment. You
should test this program thoroughly before using it in a
production environment.
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 5
REVISION HISTORY
----------------
Version 1.0 June 10, 1990 First release
Version 1.1 June 15, 1990 Maintenance release
o Added checks for DOS version running under. The
program will no longer add "@" to the DOS .BAT file if
running on DOS versions prior to 3.30
o PCBoard's "More?" prompt is now suppressed in case a
batch upload with automatic logoff is being tested
o File extensions other than .ZIP, .ARC and .PAK will now
be treated as .ZIP files. If they are not they will be
failed with an errorlevel of 11 as indicated by PKZIP
o The program will no longer attempt to check file dates
if a file has failed verification. Version 1.0
attempted to do an age test on the file if one was
indicated, regardless of previous tests
o The "Zip comment removed" message will no longer be
shown if the file has failed verification
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 6
CREDITS
-------
ExZTest likely would not have been created if it wasn't for
the 'suggestions' of Mark Rapp of Microsellar BBS who actually
proposed most of the ideas incorporated in the program. ExZTest
was finally written so that Mark can stop asking about it! :)
OK, I admit that I liked the idea as well, although my use will
likely be somewhat more limited.
I need to acknowledge the help I received from Dan Moore in
some areas, specifically in the handling of .ZIP file
directories. Although this program does not actually use his
code, without it this program would have taken a lot longer and
would have required many more hours of research!
Last but not least, this program would be useless without
David Terry's efforts (of Clark Development Co) and PCBoard
14.5's many new features and abilities.
My grateful appreciation to all!
DISTRIBUTION
------------
ExZTest is distributed as Freeware. As such, no fees of any
sort may be charged for it by anyone. Any alterations of the
code are expressly prohibited. You may use ExZTest free of
charge with no limitations. You may, if you wish, distribute it
on your BBS, however, all original files MUST be included in the
distribution file. All .ZIP files distributed by me are stamped
with PKZIP's authenticity verification stamp, which should NOT be
removed. Should you have an automated process, such as ExZip,
which removes the stamp, you may download the authentic version
anytime from the Executive Network, as a free download.
ExZTEST - On-Line File Integrity Checker for PCBoard 14.5 7